﻿using FileAppliaction.Util;
using FileApplication;
using FileApplication.EF;
using FileApplication.UNEF;
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FileAppliaction
{
    public partial class MainForm : MaterialForm
    {
        public MainForm()
        {
            InitializeComponent();
            MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance;

            //将此设置为false，以禁用对非材质蒙皮组件的背景色强制
            //这必须在AddFormToManager（）之前设置
            materialSkinManager.EnforceBackcolorOnAllComponents = true;

            //MaterialSkinManager 属性
            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
            materialSkinManager.ColorScheme = new ColorScheme(Primary.Teal400, Primary.Teal200, Primary.Teal400, Accent.DeepOrange100, TextShade.WHITE);

            //默认tab页
            TaskSpeakForm form = new TaskSpeakForm();
            DialogHelper.DirectToPage(form, voiceTab);
        }

        private void materialTabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TabPage selectedTab = materialTabControl1.SelectedTab;
            Form form =null;
            if ("voiceTab".Equals(selectedTab.Name))
            {
                form = new TaskSpeakForm();
            }
            else if ("pdfWaterMark".Equals(selectedTab.Name))
            {
                form = new PdfWatermarkForm();
            }
            else if ("uploadTabPage".Equals(selectedTab.Name))
            {
                form = new UploadForm();
            }
            else if ("bindsTabPage".Equals(selectedTab.Name))
            {
                form = new ListForm();
            }
            else if ("librarytabPage".Equals(selectedTab.Name))
            {
                form = new LibraryListForm();
            }
            if (form != null)
            {
                DialogHelper.DirectToPage(form, selectedTab);
            }
            
        }
    }
}
